package com.baizhi.controller;

import com.baizhi.feignclient.HystrixClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    private static final Logger log = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private HystrixClient hystrixClient;

    @GetMapping("test")
    public String test() {
        log.info("test server ...");
        // String demoResult = hystrixClient.demo(21);
        String demoResult = hystrixClient.demo(-1);
        log.info("demo result : {}", demoResult);
        return "test ok !!!";
    }
}
